var webpack = require('webpack');
var commonsPlugin = new webpack.optimize.CommonsChunkPlugin('common.js');
var ExtractTextPlugin = require("extract-text-webpack-plugin");

module.exports = {
	entry: {
		App:'./source/App.js',
		GroceryList: './source/GroceryList.js',
		GroceryList2: './source/GroceryList2.js',
		LikeButton: './source/LikeButton.js',
		RouteApp: './source/RouteApp.js',
		Redux1: './source/Redux1.js',
	},
	output:{
		path:__dirname,
		filename:'[name].js'
	},
	resolve: {
        extensions: ['', '.js', '.jsx']
    },
	module: {
		loaders: [
			{
				test:/\.jsx?$/,
				loader: 'babel'
			},
			{
          test: /\.css$/,
          loader: ExtractTextPlugin.extract("style-loader", "css-loader","less-loader")
      }
          // Optionally extract less files
          // or any other compile-to-css language
          //{
          //    test: /\.less$/,
          //    loader: ExtractTextPlugin.extract("style-loader", "css-loader!less-loader")
          //}
		]
	},
	plugins: [
		commonsPlugin,
        new ExtractTextPlugin('styles.css')
	]
};
